<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Returns a new PhpToken object</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="class.phptoken.html">« PhpToken</a></li>
      <li style="float: right;"><a href="phptoken.gettokenname.html">PhpToken::getTokenName »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="class.phptoken.html">PhpToken</a></li>
    <li>Returns a new PhpToken object</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="phptoken.construct" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">PhpToken::__construct</h1>
  <p class="verinfo">(PHP 8)</p><p class="refpurpose"><span class="refname">PhpToken::__construct</span> &mdash; <span class="dc-title">Returns a new PhpToken object</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-phptoken.construct-description">
  <h3 class="title">说明</h3>
  <div class="constructorsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="methodname"><strong>PhpToken::__construct</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">int</span> <code class="parameter">$id</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">string</span> <code class="parameter">$text</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">int</span> <code class="parameter">$line</code><span class="initializer"> = -1</span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type">int</span> <code class="parameter">$pos</code><span class="initializer"> = -1</span></span><br>)</div>

  <p class="para rdfs-comment">
   Returns a new PhpToken object
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-phptoken.construct-parameters">
  <h3 class="title">参数</h3>
  <dl>
   
    <dt>
<code class="parameter">id</code></dt>

    <dd>

     <p class="para">
      One of the T_* constants (see <a href="tokens.html" class="xref">解析器记号（token）列表</a>), or an ASCII codepoint representing a single-char token.
     </p>
    </dd>

   
   
    <dt>
<code class="parameter">text</code></dt>

    <dd>

     <p class="para">
      The textual content of the token.
     </p>
    </dd>

   
   
    <dt>
<code class="parameter">line</code></dt>

    <dd>

     <p class="para">
      The starting line number (1-based) of the token.
     </p>
    </dd>

   
   
    <dt>
<code class="parameter">pos</code></dt>

    <dd>

     <p class="para">
      The starting position (0-based) in the tokenized string (the number of bytes).
     </p>
    </dd>

   
  </dl>

 </div>


 <div class="refsect1 seealso" id="refsect1-phptoken.construct-seealso">
  <h3 class="title">参见</h3>
  <ul class="simplelist">
   <li class="member"><span class="function"><a href="phptoken.tokenize.html" class="function" rel="rdfs-seeAlso">PhpToken::tokenize()</a> - Splits given source into PHP tokens, represented by PhpToken objects.</span></li>
  </ul>
 </div>

</div></div></div></body></html>